package com.xmall.order.define.constants;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

@Data
@Component
@RefreshScope
public class OrderProperties {

    /**
     * 退款原因
     */
    @Value("${order.refundReason}")
    private String refundReason = "订单退款";

    /**
     * 订单subject
     */
    @Value("${order.paySubject}")
    private String paySubject = "Xmall";

    /**
     * 订单取消检查延时时间，单位毫秒
     */
    @Value("${order.cancelCheckMilliseconds}")
    private Integer cancelCheckMilliseconds = 1800000;

    /**
     * 订单支付检查延时时间，单位毫秒
     */
    @Value("${order.payCheckMilliseconds}")
    private Integer payCheckMilliseconds = 180000;

    /**
     * 订单取消日志Cron
     */
    @Value("${order.orderCancelLogRetryCron}")
    private String orderCancelLogRetryCron = "0 0/5 * * * ?";

    /**
     * 订单支付成功日志Cron
     */
    @Value("${order.orderPaySuccessLogCron}")
    private String orderPaySuccessLogCron = "0 0/5 * * * ?";

    /**
     * 订单退款日志Cron
     */
    @Value("${order.orderRefundLogRetryCron}")
    private String orderRefundLogRetryCron = "0 0/5 * * * ?";
}
